<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="API docs for the Future class from the dart:async library, for the Dart programming language.">
  <title>Future class - dart:async library - Dart API</title>
  <!-- required because all the links are pseudo-absolute -->
  <base href="..">

  <link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:500,400i,400,300|Source+Sans+Pro:400,300,700" rel="stylesheet">
  <link rel="stylesheet" href="static-assets/github.css">
  <link rel="stylesheet" href="static-assets/styles.css">
  <link rel="icon" href="static-assets/favicon.png">

</head>

<body>

<div id="overlay-under-drawer"></div>

<header id="title">
  <button id="sidenav-left-toggle" type="button">&nbsp;</button>
  <ol class="breadcrumbs gt-separated dark hidden-xs">
    <li><a href="index.html">spritewidget</a></li>
    <li><a href="dart-async/dart-async-library.html">dart:async</a></li>
    <li class="self-crumb">Future<span class="signature">&lt;<wbr><span class="type-parameter">T</span>&gt;</span> abstract class</li>
  </ol>
  <div class="self-name">Future</div>
  <form class="search navbar-right" role="search">
    <input type="text" id="search-box" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
  </form>
</header>

<main>

  <div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
    <h5>dart:async library</h5>
    <ol>
      <li class="section-title"><a href="dart-async/dart-async-library.html#classes">Classes</a></li>
      <li><a href="dart-async/Completer-class.html">Completer</a></li>
      <li><a class="deprecated" href="dart-async/DeferredLibrary-class.html">DeferredLibrary</a></li>
      <li><a href="dart-async/EventSink-class.html">EventSink</a></li>
      <li><a href="dart-async/Future-class.html">Future</a></li>
      <li><a href="dart-async/FutureOr-class.html">FutureOr</a></li>
      <li><a href="dart-async/Stream-class.html">Stream</a></li>
      <li><a href="dart-async/StreamConsumer-class.html">StreamConsumer</a></li>
      <li><a href="dart-async/StreamController-class.html">StreamController</a></li>
      <li><a href="dart-async/StreamIterator-class.html">StreamIterator</a></li>
      <li><a href="dart-async/StreamSink-class.html">StreamSink</a></li>
      <li><a href="dart-async/StreamSubscription-class.html">StreamSubscription</a></li>
      <li><a href="dart-async/StreamTransformer-class.html">StreamTransformer</a></li>
      <li><a href="dart-async/StreamTransformerBase-class.html">StreamTransformerBase</a></li>
      <li><a href="dart-async/StreamView-class.html">StreamView</a></li>
      <li><a href="dart-async/SynchronousStreamController-class.html">SynchronousStreamController</a></li>
      <li><a href="dart-async/Timer-class.html">Timer</a></li>
      <li><a href="dart-async/Zone-class.html">Zone</a></li>
      <li><a href="dart-async/ZoneDelegate-class.html">ZoneDelegate</a></li>
      <li><a href="dart-async/ZoneSpecification-class.html">ZoneSpecification</a></li>
    
    
    
      <li class="section-title"><a href="dart-async/dart-async-library.html#functions">Functions</a></li>
      <li><a href="dart-async/runZoned.html">runZoned</a></li>
      <li><a href="dart-async/scheduleMicrotask.html">scheduleMicrotask</a></li>
    
    
      <li class="section-title"><a href="dart-async/dart-async-library.html#typedefs">Typedefs</a></li>
      <li><a href="dart-async/ControllerCallback.html">ControllerCallback</a></li>
      <li><a href="dart-async/ControllerCancelCallback.html">ControllerCancelCallback</a></li>
      <li><a href="dart-async/CreatePeriodicTimerHandler.html">CreatePeriodicTimerHandler</a></li>
      <li><a href="dart-async/CreateTimerHandler.html">CreateTimerHandler</a></li>
      <li><a href="dart-async/ErrorCallbackHandler.html">ErrorCallbackHandler</a></li>
      <li><a href="dart-async/ForkHandler.html">ForkHandler</a></li>
      <li><a href="dart-async/HandleUncaughtErrorHandler.html">HandleUncaughtErrorHandler</a></li>
      <li><a href="dart-async/PrintHandler.html">PrintHandler</a></li>
      <li><a href="dart-async/RegisterBinaryCallbackHandler.html">RegisterBinaryCallbackHandler</a></li>
      <li><a href="dart-async/RegisterCallbackHandler.html">RegisterCallbackHandler</a></li>
      <li><a href="dart-async/RegisterUnaryCallbackHandler.html">RegisterUnaryCallbackHandler</a></li>
      <li><a href="dart-async/RunBinaryHandler.html">RunBinaryHandler</a></li>
      <li><a href="dart-async/RunHandler.html">RunHandler</a></li>
      <li><a href="dart-async/RunUnaryHandler.html">RunUnaryHandler</a></li>
      <li><a href="dart-async/ScheduleMicrotaskHandler.html">ScheduleMicrotaskHandler</a></li>
      <li><a href="dart-async/ZoneBinaryCallback.html">ZoneBinaryCallback</a></li>
      <li><a href="dart-async/ZoneCallback.html">ZoneCallback</a></li>
      <li><a href="dart-async/ZoneUnaryCallback.html">ZoneUnaryCallback</a></li>
    
      <li class="section-title"><a href="dart-async/dart-async-library.html#exceptions">Exceptions</a></li>
      <li><a href="dart-async/AsyncError-class.html">AsyncError</a></li>
      <li><a href="dart-async/DeferredLoadException-class.html">DeferredLoadException</a></li>
      <li><a href="dart-async/TimeoutException-class.html">TimeoutException</a></li>
    </ol>
  </div>

  <div class="col-xs-12 col-sm-9 col-md-8 main-content">
    <h1>Future&lt;<wbr><span class="type-parameter">T</span>&gt; class</h1>

    <section class="desc markdown">
      <p>An object representing a delayed computation.</p>
<p>A <a href="dart-async/Future-class.html">Future</a> is used to represent a potential value, or error,
that will be available at some time in the future.
Receivers of a <a href="dart-async/Future-class.html">Future</a> can register callbacks
that handle the value or error once it is available.
For example:</p>
<pre class="language-dart"><code>Future&lt;int&gt; future = getFuture();
future.then((value) =&gt; handleValue(value))
      .catchError((error) =&gt; handleError(error));
</code></pre>
<p>A <a href="dart-async/Future-class.html">Future</a> can be completed in two ways:
with a value ("the future succeeds")
or with an error ("the future fails").
Users can install callbacks for each case.</p>
<p>In some cases we say that a future is completed with another future.
This is a short way of stating that the future is completed in the same way,
with the same value or error,
as the other future once that completes.
Whenever a function in the core library may complete a future
(for example <a href="dart-async/Completer/complete.html">Completer.complete</a> or <a href="dart-async/Future/Future.value.html">new Future.value</a>),
then it also accepts another future and does this work for the developer.</p>
<p>The result of registering a pair of callbacks is a new Future (the
"successor") which in turn is completed with the result of invoking the
corresponding callback.
The successor is completed with an error if the invoked callback throws.
For example:</p>
<pre class="language-dart"><code>Future&lt;int&gt; successor = future.then((int value) {
    // Invoked when the future is completed with a value.
    return 42;  // The successor is completed with the value 42.
  },
  onError: (e) {
    // Invoked when the future is completed with an error.
    if (canHandle(e)) {
      return 499;  // The successor is completed with the value 499.
    } else {
      throw e;  // The successor is completed with the error e.
    }
  });
</code></pre>
<p>If a future does not have a successor when it completes with an error,
it forwards the error message to the global error-handler.
This behavior makes sure that no error is silently dropped.
However, it also means that error handlers should be installed early,
so that they are present as soon as a future is completed with an error.
The following example demonstrates this potential bug:</p>
<pre class="language-dart"><code>var future = getFuture();
new Timer(new Duration(milliseconds: 5), () {
  // The error-handler is not attached until 5 ms after the future has
  // been received. If the future fails before that, the error is
  // forwarded to the global error-handler, even though there is code
  // (just below) to eventually handle the error.
  future.then((value) { useValue(value); },
              onError: (e) { handleError(e); });
});
</code></pre>
<p>When registering callbacks, it's often more readable to register the two
callbacks separately, by first using <a href="dart-async/Future/then.html">then</a> with one argument
(the value handler) and using a second <a href="dart-async/Future/catchError.html">catchError</a> for handling errors.
Each of these will forward the result that they don't handle
to their successors, and together they handle both value and error result.
It also has the additional benefit of the <a href="dart-async/Future/catchError.html">catchError</a> handling errors in the
<a href="dart-async/Future/then.html">then</a> value callback too.
Using sequential handlers instead of parallel ones often leads to code that
is easier to reason about.
It also makes asynchronous code very similar to synchronous code:</p>
<pre class="language-dart"><code>// Synchronous code.
try {
  int value = foo();
  return bar(value);
} catch (e) {
  return 499;
}
</code></pre>
<p>Equivalent asynchronous code, based on futures:</p>
<pre class="language-dart"><code>Future&lt;int&gt; future = new Future(foo);  // Result of foo() as a future.
future.then((int value) =&gt; bar(value))
      .catchError((e) =&gt; 499);
</code></pre>
<p>Similar to the synchronous code, the error handler (registered with
<a href="dart-async/Future/catchError.html">catchError</a>) is handling any errors thrown by either <code>foo</code> or <code>bar</code>.
If the error-handler had been registered as the <code>onError</code> parameter of
the <code>then</code> call, it would not catch errors from the <code>bar</code> call.</p>
<p>Futures can have more than one callback-pair registered. Each successor is
treated independently and is handled as if it was the only successor.</p>
<p>A future may also fail to ever complete. In that case, no callbacks are
called.</p>
    </section>
    

    <section class="summary offset-anchor" id="constructors">
      <h2>Constructors</h2>

      <dl class="constructor-summary-list">
        <dt id="Future" class="callable">
          <span class="name"><a href="dart-async/Future/Future.html">Future</a></span><span class="signature">(<span class="parameter" id="-param-computation"><span class="type-annotation"><a href="dart-async/FutureOr-class.html">FutureOr</a><span class="signature">&lt;<wbr><span class="type-parameter">T</span>&gt;</span></span> <span class="parameter-name">computation</span>()</span>)</span>
        </dt>
        <dd>
          Creates a future containing the result of calling <code>computation</code>
asynchronously with <a href="dart-async/Timer/run.html">Timer.run</a>. <a href="dart-async/Future/Future.html">[...]</a>
          <div class="constructor-modifier features">factory</div>
        </dd>
        <dt id="Future.delayed" class="callable">
          <span class="name"><a href="dart-async/Future/Future.delayed.html">Future.delayed</a></span><span class="signature">(<span class="parameter" id="delayed-param-duration"><span class="type-annotation"><a href="dart-core/Duration-class.html">Duration</a></span> <span class="parameter-name">duration</span>, [</span> <span class="parameter" id="delayed-param-computation"><span class="type-annotation"><a href="dart-async/FutureOr-class.html">FutureOr</a><span class="signature">&lt;<wbr><span class="type-parameter">T</span>&gt;</span></span> <span class="parameter-name">computation</span>()</span> ])</span>
        </dt>
        <dd>
          Creates a future that runs its computation after a delay. <a href="dart-async/Future/Future.delayed.html">[...]</a>
          <div class="constructor-modifier features">factory</div>
        </dd>
        <dt id="Future.error" class="callable">
          <span class="name"><a href="dart-async/Future/Future.error.html">Future.error</a></span><span class="signature">(<span class="parameter" id="error-param-error"><span class="type-annotation"><a href="dart-core/Object-class.html">Object</a></span> <span class="parameter-name">error</span>, [</span> <span class="parameter" id="error-param-stackTrace"><span class="type-annotation"><a href="dart-core/StackTrace-class.html">StackTrace</a></span> <span class="parameter-name">stackTrace</span></span> ])</span>
        </dt>
        <dd>
          Creates a future that completes with an error. <a href="dart-async/Future/Future.error.html">[...]</a>
          <div class="constructor-modifier features">factory</div>
        </dd>
        <dt id="Future.microtask" class="callable">
          <span class="name"><a href="dart-async/Future/Future.microtask.html">Future.microtask</a></span><span class="signature">(<span class="parameter" id="microtask-param-computation"><span class="type-annotation"><a href="dart-async/FutureOr-class.html">FutureOr</a><span class="signature">&lt;<wbr><span class="type-parameter">T</span>&gt;</span></span> <span class="parameter-name">computation</span>()</span>)</span>
        </dt>
        <dd>
          Creates a future containing the result of calling <code>computation</code>
asynchronously with <a href="dart-async/scheduleMicrotask.html">scheduleMicrotask</a>. <a href="dart-async/Future/Future.microtask.html">[...]</a>
          <div class="constructor-modifier features">factory</div>
        </dd>
        <dt id="Future.sync" class="callable">
          <span class="name"><a href="dart-async/Future/Future.sync.html">Future.sync</a></span><span class="signature">(<span class="parameter" id="sync-param-computation"><span class="type-annotation"><a href="dart-async/FutureOr-class.html">FutureOr</a><span class="signature">&lt;<wbr><span class="type-parameter">T</span>&gt;</span></span> <span class="parameter-name">computation</span>()</span>)</span>
        </dt>
        <dd>
          Returns a future containing the result of immediately calling
<code>computation</code>. <a href="dart-async/Future/Future.sync.html">[...]</a>
          <div class="constructor-modifier features">factory</div>
        </dd>
        <dt id="Future.value" class="callable">
          <span class="name"><a href="dart-async/Future/Future.value.html">Future.value</a></span><span class="signature">([<span class="parameter" id="value-param-value"><span class="type-annotation"><a href="dart-async/FutureOr-class.html">FutureOr</a><span class="signature">&lt;<wbr><span class="type-parameter">T</span>&gt;</span></span> <span class="parameter-name">value</span></span> ])</span>
        </dt>
        <dd>
          Creates a future completed with <code>value</code>. <a href="dart-async/Future/Future.value.html">[...]</a>
          <div class="constructor-modifier features">factory</div>
        </dd>
      </dl>
    </section>

    <section class="summary offset-anchor inherited" id="instance-properties">
      <h2>Properties</h2>

      <dl class="properties">
        <dt id="hashCode" class="property inherited">
          <span class="name"><a href="dart-core/Object/hashCode.html">hashCode</a></span>
          <span class="signature">&#8594; <a href="dart-core/int-class.html">int</a></span>
        </dt>
        <dd class="inherited">
          The hash code for this object. <a href="dart-core/Object/hashCode.html">[...]</a>
          <div class="features">read-only, inherited</div>
</dd>
        <dt id="runtimeType" class="property inherited">
          <span class="name"><a href="dart-core/Object/runtimeType.html">runtimeType</a></span>
          <span class="signature">&#8594; <a href="dart-core/Type-class.html">Type</a></span>
        </dt>
        <dd class="inherited">
          A representation of the runtime type of the object.
          <div class="features">read-only, inherited</div>
</dd>
      </dl>
    </section>

    <section class="summary offset-anchor" id="instance-methods">
      <h2>Methods</h2>
      <dl class="callables">
        <dt id="asStream" class="callable">
          <span class="name"><a href="dart-async/Future/asStream.html">asStream</a></span><span class="signature">(<wbr>)
            <span class="returntype parameter">&#8594; <a href="dart-async/Stream-class.html">Stream</a><span class="signature">&lt;<wbr><span class="type-parameter">T</span>&gt;</span></span>
          </span>
        </dt>
        <dd>
          Creates a <a href="dart-async/Stream-class.html">Stream</a> containing the result of this future. <a href="dart-async/Future/asStream.html">[...]</a>
          
</dd>
        <dt id="catchError" class="callable">
          <span class="name"><a href="dart-async/Future/catchError.html">catchError</a></span><span class="signature">(<wbr><span class="parameter" id="catchError-param-onError"><span class="type-annotation"><a href="dart-core/Function-class.html">Function</a></span> <span class="parameter-name">onError</span>, {</span> <span class="parameter" id="catchError-param-test"><span class="type-annotation"><a href="dart-core/bool-class.html">bool</a></span> <span class="parameter-name">test</span>(<span class="parameter" id="test-param-error"><span class="type-annotation"><a href="dart-core/Object-class.html">Object</a></span> <span class="parameter-name">error</span></span>)</span> })
            <span class="returntype parameter">&#8594; <a href="dart-async/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter">T</span>&gt;</span></span>
          </span>
        </dt>
        <dd>
          Handles errors emitted by this <a href="dart-async/Future-class.html">Future</a>. <a href="dart-async/Future/catchError.html">[...]</a>
          
</dd>
        <dt id="then" class="callable">
          <span class="name"><a href="dart-async/Future/then.html">then</a></span><span class="signature">&lt;<wbr><span class="type-parameter">S</span>&gt;</span><span class="signature">(<wbr><span class="parameter" id="then-param-onValue"><span class="type-annotation"><a href="dart-async/FutureOr-class.html">FutureOr</a><span class="signature">&lt;<wbr><span class="type-parameter">S</span>&gt;</span></span> <span class="parameter-name">onValue</span>(<span class="parameter" id="onValue-param-value"><span class="type-annotation">T</span> <span class="parameter-name">value</span></span>), {</span> <span class="parameter" id="then-param-onError"><span class="type-annotation"><a href="dart-core/Function-class.html">Function</a></span> <span class="parameter-name">onError</span></span> })
            <span class="returntype parameter">&#8594; <a href="dart-async/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter">S</span>&gt;</span></span>
          </span>
        </dt>
        <dd>
          Register callbacks to be called when this future completes. <a href="dart-async/Future/then.html">[...]</a>
          
</dd>
        <dt id="timeout" class="callable">
          <span class="name"><a href="dart-async/Future/timeout.html">timeout</a></span><span class="signature">(<wbr><span class="parameter" id="timeout-param-timeLimit"><span class="type-annotation"><a href="dart-core/Duration-class.html">Duration</a></span> <span class="parameter-name">timeLimit</span>, {</span> <span class="parameter" id="timeout-param-onTimeout"><span class="type-annotation"><a href="dart-async/FutureOr-class.html">FutureOr</a><span class="signature">&lt;<wbr><span class="type-parameter">T</span>&gt;</span></span> <span class="parameter-name">onTimeout</span>()</span> })
            <span class="returntype parameter">&#8594; <a href="dart-async/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter">T</span>&gt;</span></span>
          </span>
        </dt>
        <dd>
          Time-out the future computation after <code>timeLimit</code> has passed. <a href="dart-async/Future/timeout.html">[...]</a>
          
</dd>
        <dt id="whenComplete" class="callable">
          <span class="name"><a href="dart-async/Future/whenComplete.html">whenComplete</a></span><span class="signature">(<wbr><span class="parameter" id="whenComplete-param-action"><span class="type-annotation"><a href="dart-async/FutureOr-class.html">FutureOr</a></span> <span class="parameter-name">action</span>()</span>)
            <span class="returntype parameter">&#8594; <a href="dart-async/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter">T</span>&gt;</span></span>
          </span>
        </dt>
        <dd>
          Registers a function to be called when this future completes. <a href="dart-async/Future/whenComplete.html">[...]</a>
          
</dd>
        <dt id="noSuchMethod" class="callable inherited">
          <span class="name"><a href="dart-core/Object/noSuchMethod.html">noSuchMethod</a></span><span class="signature">(<wbr><span class="parameter" id="noSuchMethod-param-invocation"><span class="type-annotation"><a href="dart-core/Invocation-class.html">Invocation</a></span> <span class="parameter-name">invocation</span></span>)
            <span class="returntype parameter">&#8594; dynamic</span>
          </span>
        </dt>
        <dd class="inherited">
          Invoked when a non-existent method or property is accessed. <a href="dart-core/Object/noSuchMethod.html">[...]</a>
          <div class="features">inherited</div>
</dd>
        <dt id="toString" class="callable inherited">
          <span class="name"><a href="dart-core/Object/toString.html">toString</a></span><span class="signature">(<wbr>)
            <span class="returntype parameter">&#8594; <a href="dart-core/String-class.html">String</a></span>
          </span>
        </dt>
        <dd class="inherited">
          Returns a string representation of this object.
          <div class="features">inherited</div>
</dd>
      </dl>
    </section>

    <section class="summary offset-anchor inherited" id="operators">
      <h2>Operators</h2>
      <dl class="callables">
        <dt id="operator ==" class="callable inherited">
          <span class="name"><a href="dart-core/Object/operator_equals.html">operator ==</a></span><span class="signature">(<wbr><span class="parameter" id="==-param-other"><span class="type-annotation">dynamic</span> <span class="parameter-name">other</span></span>)
            <span class="returntype parameter">&#8594; <a href="dart-core/bool-class.html">bool</a></span>
          </span>
        </dt>
        <dd class="inherited">
          The equality operator. <a href="dart-core/Object/operator_equals.html">[...]</a>
          <div class="features">inherited</div>
</dd>
      </dl>
    </section>


    <section class="summary offset-anchor" id="static-methods">
      <h2>Static Methods</h2>
      <dl class="callables">
        <dt id="any" class="callable">
          <span class="name"><a href="dart-async/Future/any.html">any</a></span><span class="signature">&lt;<wbr><span class="type-parameter">T</span>&gt;</span><span class="signature">(<wbr><span class="parameter" id="any-param-futures"><span class="type-annotation"><a href="dart-core/Iterable-class.html">Iterable</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="dart-async/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter">T</span>&gt;</span></span>&gt;</span></span> <span class="parameter-name">futures</span></span>)
            <span class="returntype parameter">&#8594; <a href="dart-async/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter">T</span>&gt;</span></span>
          </span>
        </dt>
        <dd>
          Returns the result of the first future in <code>futures</code> to complete. <a href="dart-async/Future/any.html">[...]</a>
          
</dd>
        <dt id="doWhile" class="callable">
          <span class="name"><a href="dart-async/Future/doWhile.html">doWhile</a></span><span class="signature">(<wbr><span class="parameter" id="doWhile-param-action"><span class="type-annotation"><a href="dart-async/FutureOr-class.html">FutureOr</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="dart-core/bool-class.html">bool</a></span>&gt;</span></span> <span class="parameter-name">action</span>()</span>)
            <span class="returntype parameter">&#8594; <a href="dart-async/Future-class.html">Future</a></span>
          </span>
        </dt>
        <dd>
          Performs an operation repeatedly until it returns <code>false</code>. <a href="dart-async/Future/doWhile.html">[...]</a>
          
</dd>
        <dt id="forEach" class="callable">
          <span class="name"><a href="dart-async/Future/forEach.html">forEach</a></span><span class="signature">&lt;<wbr><span class="type-parameter">T</span>&gt;</span><span class="signature">(<wbr><span class="parameter" id="forEach-param-elements"><span class="type-annotation"><a href="dart-core/Iterable-class.html">Iterable</a><span class="signature">&lt;<wbr><span class="type-parameter">T</span>&gt;</span></span> <span class="parameter-name">elements</span>, </span> <span class="parameter" id="forEach-param-action"><span class="type-annotation"><a href="dart-async/FutureOr-class.html">FutureOr</a></span> <span class="parameter-name">action</span>(<span class="parameter" id="action-param-element"><span class="type-annotation">T</span> <span class="parameter-name">element</span></span>)</span>)
            <span class="returntype parameter">&#8594; <a href="dart-async/Future-class.html">Future</a></span>
          </span>
        </dt>
        <dd>
          Performs an action for each element of the iterable, in turn. <a href="dart-async/Future/forEach.html">[...]</a>
          
</dd>
        <dt id="wait" class="callable">
          <span class="name"><a href="dart-async/Future/wait.html">wait</a></span><span class="signature">&lt;<wbr><span class="type-parameter">T</span>&gt;</span><span class="signature">(<wbr><span class="parameter" id="wait-param-futures"><span class="type-annotation"><a href="dart-core/Iterable-class.html">Iterable</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="dart-async/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter">T</span>&gt;</span></span>&gt;</span></span> <span class="parameter-name">futures</span>, {</span> <span class="parameter" id="wait-param-eagerError"><span class="type-annotation"><a href="dart-core/bool-class.html">bool</a></span> <span class="parameter-name">eagerError</span>: <span class="default-value">false</span>, </span> <span class="parameter" id="wait-param-cleanUp"><span class="type-annotation">void</span> <span class="parameter-name">cleanUp</span>(<span class="parameter" id="cleanUp-param-successValue"><span class="type-annotation">T</span> <span class="parameter-name">successValue</span></span>)</span> })
            <span class="returntype parameter">&#8594; <a href="dart-async/Future-class.html">Future</a><span class="signature">&lt;<wbr><span class="type-parameter"><a href="dart-core/List-class.html">List</a><span class="signature">&lt;<wbr><span class="type-parameter">T</span>&gt;</span></span>&gt;</span></span>
          </span>
        </dt>
        <dd>
          Waits for multiple futures to complete and collects their results. <a href="dart-async/Future/wait.html">[...]</a>
          
</dd>
      </dl>
    </section>


  </div> <!-- /.main-content -->

  <div class="col-xs-6 col-sm-6 col-md-2 sidebar sidebar-offcanvas-right">
    <ol>
      <li class="section-title"><a href="dart-async/Future-class.html#constructors">Constructors</a></li>
      <li><a href="dart-async/Future/Future.html">Future</a></li>
      <li><a href="dart-async/Future/Future.delayed.html">delayed</a></li>
      <li><a href="dart-async/Future/Future.error.html">error</a></li>
      <li><a href="dart-async/Future/Future.microtask.html">microtask</a></li>
      <li><a href="dart-async/Future/Future.sync.html">sync</a></li>
      <li><a href="dart-async/Future/Future.value.html">value</a></li>
    
      <li class="section-title inherited">
        <a href="dart-async/Future-class.html#instance-properties">Properties</a>
      </li>
      <li class="inherited"><a href="dart-core/Object/hashCode.html">hashCode</a></li>
      <li class="inherited"><a href="dart-core/Object/runtimeType.html">runtimeType</a></li>
    
      <li class="section-title"><a href="dart-async/Future-class.html#instance-methods">Methods</a></li>
      <li><a href="dart-async/Future/asStream.html">asStream</a></li>
      <li><a href="dart-async/Future/catchError.html">catchError</a></li>
      <li><a href="dart-async/Future/then.html">then</a></li>
      <li><a href="dart-async/Future/timeout.html">timeout</a></li>
      <li><a href="dart-async/Future/whenComplete.html">whenComplete</a></li>
      <li class="inherited"><a href="dart-core/Object/noSuchMethod.html">noSuchMethod</a></li>
      <li class="inherited"><a href="dart-core/Object/toString.html">toString</a></li>
    
      <li class="section-title inherited"><a href="dart-async/Future-class.html#operators">Operators</a></li>
      <li class="inherited"><a href="dart-core/Object/operator_equals.html">operator ==</a></li>
    
    
      <li class="section-title"><a href="dart-async/Future-class.html#static-methods">Static methods</a></li>
      <li><a href="dart-async/Future/any.html">any</a></li>
      <li><a href="dart-async/Future/doWhile.html">doWhile</a></li>
      <li><a href="dart-async/Future/forEach.html">forEach</a></li>
      <li><a href="dart-async/Future/wait.html">wait</a></li>
    
    </ol>
  </div><!--/.sidebar-offcanvas-->

</main>

<footer>
  <span class="no-break">
    spritewidget 0.9.16
  </span>

</footer>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="static-assets/typeahead.bundle.min.js"></script>
<script src="static-assets/highlight.pack.js"></script>
<script src="static-assets/URI.js"></script>
<script src="static-assets/script.js"></script>


</body>

</html>
